package com.ibeetl.cms.service;

import java.util.List;

import com.ibeetl.cms.entity.IndustrialTalents;
import com.ibeetl.cms.web.query.BuyHouseSubsidiesQuery;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.ibeetl.cms.dao.BuyHouseSubsidiesDao;
import com.ibeetl.cms.entity.BuyHouseSubsidies;
import com.ibeetl.admin.core.service.BaseService;

/**
 * BuyHouseSubsidies Service
 */

@Service
@Transactional
public class BuyHouseSubsidiesService extends BaseService<BuyHouseSubsidies>{

    @Autowired private BuyHouseSubsidiesDao buyHouseSubsidiesDao;

    public PageQuery<BuyHouseSubsidies>queryByCondition(PageQuery query){
        PageQuery ret =  buyHouseSubsidiesDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelBuyHouseSubsidies(List<Long> ids){
        try {
            buyHouseSubsidiesDao.batchDelBuyHouseSubsidiesByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除BuyHouseSubsidies失败", e);
        }
    }

    public List<BuyHouseSubsidies> queryCompany(BuyHouseSubsidiesQuery condtion) {
        List<BuyHouseSubsidies> ret =  buyHouseSubsidiesDao.queryCompany(condtion);
        queryListAfter(ret);
        return ret;
    }

    public PageQuery<IndustrialTalents> queryEmployees(PageQuery page) {
        page.setPageSize(Integer.MAX_VALUE);

        page.setPageSize(Integer.MAX_VALUE);
        PageQuery ret =  buyHouseSubsidiesDao.queryEmployees(page);
        queryListAfter(ret.getList());
        return ret;
    }


    public int queryEmployeesCount(BuyHouseSubsidiesQuery query) {
        return buyHouseSubsidiesDao.queryEmployeesCount(query);
    }

    public PageQuery<IndustrialTalents> queryDoneTask(PageQuery page) {
        PageQuery ret =  buyHouseSubsidiesDao.queryDoneTask(page);
        queryListAfter(ret.getList());
        return ret;

    }

    //查企业
    public PageQuery<BuyHouseSubsidies>findenterprise(PageQuery query){
        PageQuery ret =  buyHouseSubsidiesDao.findenterprise(query);
        queryListAfter(ret.getList());
        return ret;
    }
}